package com.suixuan.test

class User {

	String username

	String password

	boolean enabled

	Address address

	static hasMany = [roles : Role]
	
	static belongsTo =  [Role]

	static constraints = {
		username(blank:false, size : 6..12)
		password(blank:false, size : 6..12)
		enabled(blank:false)
	}

	static embedded = {address}

	static mapping = {
		table '_user'

		username column : '_username'
		password column : '_password'
		enabled column : '_enabled'

		address column : '_address_id'


	}
}
